<%@ include file = "/common/ini.jsp"%>
<%@ include file = "/common/_log4j.jsp"%>
<%@ include file = "/common/_ApplicationContext_init.jsp"%>
<%@ include file = "/js/_js_for_select.jsp"%>
<script>
    delAllOptions(parent.detailForm.areaId);
    delAllOptions(parent.detailForm.parentId);
    parent.detailForm.parentId.disabled = true;
    addOption(parent.detailForm.areaId,"null","无");
    addOption(parent.detailForm.parentId,"null","无");
<%
    logger.debug("开始查询主页对应的分区");
    if(request.getParameter("homeId") != null && !request.getParameter("homeId").equals("null"))
    {
        HomeManager homeManager = (HomeManager)applicationContext.getBean("homeManager");
        Home home = (Home)homeManager.get(request.getParameter("homeId"));
        Object[] areas = home.getAreas().toArray();
        for(int i = 0; i < areas.length; i ++)
        {
            Area area = (Area)areas[i];
            %>addOption(parent.detailForm.areaId,"<%= area.getId()%>","<%= area.getName()%>");<%
        } // for
        if(request.getParameter("areaId")!= null)
        {
            %>parent.detailForm.areaId.value="<%= request.getParameter("areaId")%>";<%
        }
    }// if
%>
    parent.detailForm.parentId.disabled = false;
</script> 
